if($.cookie('turned') == 1)
{
	$(document).ready(function()
	{
		var refreshId = setInterval( function()
		{
			$('#turned_on').trigger('click');
			updateStatus();
		}, 2600);
	});
}
function updateStatus()
{
	var detection = $("#response").val();
	
	if(detection == 0 || detection == 1)
	{
		var request = $.ajax({
			type: "POST",
			url: "http://azuneca.rs.af.cm/handle.php",
			data: { movement : detection }
		});
	}
}